package com.blankland.dataanalysis.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blankland.dataanalysis.domain.GammaAnalyseData;
import com.blankland.dataanalysis.mapper.GammaAnalyseDataMapper;
import com.blankland.dataanalysis.result.Result;
import com.blankland.dataanalysis.service.GammaAnalyseDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
/**
 * 解析后的谱线数据
 */

@Api(tags = "解析后的谱线数据")
@RestController
@RequestMapping("/admin/system/gammaAnalyseData")
public class GammaAnalyseDataController {

    @Autowired
    private GammaAnalyseDataService gammaAnalyseDataService;


    @ApiOperation("/查看所有数据")
    @GetMapping("/list")
    public Result findAllData(@RequestParam Integer pageNum,
                              @RequestParam Integer pageSize,
                              Long deviceId){
        Page<GammaAnalyseData> page = new Page<>(pageNum, pageSize);
        QueryWrapper<GammaAnalyseData> wrapper = new QueryWrapper<>();
        wrapper.eq("device_id",deviceId);
        Page<GammaAnalyseData> pagelist = gammaAnalyseDataService.page(page, wrapper);
        return Result.ok(pagelist);
    }
}
